package com.cn.mapper.dao.db5.PartsManagement;

import com.cn.bean.pojo.PartsManagement.BusinessTypeTable;
import com.cn.bean.pojo.sys.System_parameter_sub_table;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BusinessTypeDao {
    //查找状态为1的分类
    List<BusinessTypeTable> selectBusinessTypeAsideAuto1();

    //   @Select("select * from BusinessTypeTable")
    List<BusinessTypeTable> selectBusinessTypeAside();

    //   @Select("SELECT *, (SELECT COUNT(*)  FROM BusinessTypeTable) AS total FROM (SELECT ROW_NUMBER() OVER (ORDER BY ID,level,parentID,isLeaf) AS row_num, * FROM BusinessTypeTable)AS numbered WHERE row_num BETWEEN #{page} * #{limit} - #{limit} + 1 AND #{page} * #{limit}")
    List<BusinessTypeTable> selectBusinessType(@Param("limit") int limit, @Param("page") int page);

    //  查询组织类型
    List<System_parameter_sub_table> selectSystem_parameter_sub_table(@Param("tableName") String tableName, @Param("field") String field);

    int addBusinessType(@Param("ID") int ID, @Param("code") String code, @Param("name") String name, @Param("description") String description, @Param("status") int status, @Param("level") int level, @Param("parentID") int parentID, @Param("isLeaf") int isLeaf);

    int deleteBusinessType(@Param("ID") int ID);
    int upDateBusinessType(@Param("ID") int ID, @Param("code") String code, @Param("name") String name, @Param("description") String description, @Param("status") int status, @Param("level") int level, @Param("parentID") int parentID, @Param("isLeaf") int isLeaf);
    List<BusinessTypeTable> selectBusinessTypeId(@Param("businessTypeID")int businessTypeID);
//    查询所有分类/查询所有定义/查询当前分类/查询当前定义

}
